home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Merciful 1
/
Merciful - Disc 1.iso
/
software
/
l
/
lsd_grapevine
/
lsdgrapevine09a.dms
/
lsdgrapevine09a.adf
/
source
/
Fading.s
next >
Wrap
Text File
|
1990-09-06
|
3KB
|
81 lines
* FADE COLOURS ROUTINE
* © 1992 DAVID 'BART' DUSTIN / KAOS PRODUCTIONS
FADECOLS:
CMP.W #0,FADECOUNT ; Have we finished fading
BEQ.S .NOFADE ; Don't do anything if we have
SUBQ #1,FADECOUNT ; Subtract one from fadecounter
LEA COLSPACE,A0 ; Pointer to new colours
LEA COLS+2,A1 ; Pointer to old colours
MOVEQ #7,D0 ; Number of colours -1
MOVEQ #4,D1 ; Distance between colours
.FADELOOP
MOVE.W #%1111000000000000,D4 ; We only want one col at a time
BSR.S .DOWORK
BEQ.S .NORED
BGT.S .SUBRED
ADD.W #$0200,(A1) ; Increase Red value
.SUBRED
SUB.W #$0100,(A1) ; Decrease Red value
.NORED
BSR.S .DOWORK
BEQ.S .NOGREEN
BGT.S .SUBGREEN
ADD.W #$0020,(A1) ; Increase Green value
.SUBGREEN
SUB.W #$0010,(A1) ; Decrease Green value
.NOGREEN
BSR.S .DOWORK
BEQ.S .NOBLUE
BGT.S .SUBBLUE
ADDQ.W #$0002,(A1) ; Increase Blue value
.SUBBLUE
SUBQ.W #$0001,(A1) ; Decrease Blue value
.NOBLUE
LEA 2(A0),A0 ; Advance to next colour (word)
ADD.L D1,A1 ; Distance between cols
DBRA D0,.FADELOOP
.NOFADE
RTS ; Exit from sub-routine
***************************************
.DOWORK
LSR.W #4,D4 ; Advance to next value
MOVE.W (A0),D2 ; Get new colour value
MOVE.W (A1),D3 ; Get current colour value
AND.W D4,D2 ; Only work with one section
AND.W D4,D3 ; Only work with one section
CMP.W D2,D3 ; Compare two values
RTS
**********************************************************************
**********************************************************************
FADECOUNT:
DC.W 16 ; Maximum number of loops
***************************************
COLOURS: ; Table of new colours
DC.W $000,$222,$444,$666,$888,$AAA,$CCC,$EEE
*********************************************************************
COLS: ; Colour palette in CopperList
DC.L $01800000,$01820000,$01840000,$01860000
DC.L $01880000,$018A0000,$018C0000,$018E0000